<?php
function writeName()
{
  echo "cao ni ma";
}
echo "wsnbb";
writeName();
?>
PHP 函数 - 添加参数<br>
<?php
function writeName2($fname)
{
  echo $fname . " Refsnes.<br>";
}

echo "My name is ";
writeName2("Kai Jim");
echo "My sister's name is ";
writeName2("Hege");
echo "My brother's name is ";
writeName2("Stale");
?>
PHP 函数 - 返回值
<?php
function add($x, $y)
{
  $total = $x + $y;
  return $total;
}

echo "1 + 16 = " . add(1, 16);
?>